from django.db import models
from merchandise.models import Merchandise
from apps.user.models import User


# Create your models here.
class Order(models.Model):
    order_no = models.TextField()
    status = models.IntegerField(default=0)
    money = models.FloatField()
    subject = models.TextField()
    create_time = models.DateTimeField(auto_now_add=True)
    update_time = models.DateTimeField(auto_now=True)
    merchandise = models.ForeignKey(Merchandise, on_delete=models.CASCADE)
    user = models.ForeignKey(User, on_delete=models.CASCADE)

    # user = models.ForeignKey(User, on_delete=models.CASCADE)

    class Meta:
        db_table = 'order'
